package com.utils;

import com.alibaba.fastjson.JSON;

/**
 * 返回值工具类
 * @author lqp 
 */
public class Ret {
	private String statusCode="";//返回状态码  200 操作成功 300 操作失败 301 会话超时
	private String message="";//返回信息
	private String navTabId;//服务器转回navTabId可以把那个navTab标记为reloadFlag=1, 下次切换到那个navTab时会重新载入内容.
	private String callbackType;//closeCurrent就会关闭当前tab
	private String forwardUrl;//只有callbackType="forward"时需要forwardUrl值
	private String rel;//局部刷新容器ID
	
	public Ret() {
		
	}
	public Ret(String statusCode, String message) {
		this.statusCode = statusCode;
		this.message = message;
	}
	public Ret(String statusCode, String message, String navTabId) {
		this.statusCode = statusCode;
		this.message = message;
		this.navTabId = navTabId;
	}
	public Ret(String statusCode, String message, String navTabId,String callbackType, String forwardUrl) {
		this.statusCode = statusCode;
		this.message = message;
		this.navTabId = navTabId;
		this.callbackType = callbackType;
		this.forwardUrl = forwardUrl;
	}
	public Ret(String statusCode, String message, String navTabId,
			String callbackType, String forwardUrl, String rel) {
		this.statusCode = statusCode;
		this.message = message;
		this.navTabId = navTabId;
		this.callbackType = callbackType;
		this.forwardUrl = forwardUrl;
		this.rel = rel;
	}
	/**
	 * 转为JSON返回
	 * @return 固定格式的输出结果
	 */
	public String toJsonString(){
		return JSON.toJSONString(this);
	}
	
	public String getStatusCode() {
		return statusCode;
	}
	public void setStatusCode(String statusCode) {
		this.statusCode = statusCode;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public String getNavTabId() {
		return navTabId;
	}
	public void setNavTabId(String navTabId) {
		this.navTabId = navTabId;
	}
	public String getCallbackType() {
		return callbackType;
	}
	public void setCallbackType(String callbackType) {
		this.callbackType = callbackType;
	}
	public String getForwardUrl() {
		return forwardUrl;
	}
	public void setForwardUrl(String forwardUrl) {
		this.forwardUrl = forwardUrl;
	}
	public String getRel() {
		return rel;
	}
	public void setRel(String rel) {
		this.rel = rel;
	}
}
